package com.akaovi.exp.exp11.utils;

/**
 * @author akaovi
 * @version 1.0
 * @description
 * @date 2022/11/29 13:07
 * @since 2022/11/29 13:07
 */
public class Utils {
    /**
     * 判断一个字符串是否为空
     * @param string a String
     * @return boolean
     */
    public static boolean isEmpty(String string) {
        if (string == null || string.length() == 0) {
            return true;
        }
        return false;
    }

    /**
     * 有一个为空则为 true
     * @param strings some strings
     * @return boolean
     */
    public static boolean isAnyEmpty(String... strings) {
        for (String string : strings) {
            if (isEmpty(string)) {
                return true;
            }
        }
        return false;
    }

    /**
     * 所有字符串为空则为 true
     * @param strings some strings
     * @return boolean
     */
    public static boolean isAllEmpty(String... strings) {
        for (String string : strings) {
            if (!isEmpty(string)) {
                return false;
            }
        }
        return true;
    }
}
